const Router = require('koa-router')
const { catchError, generateOk, check } = require('../../lib/check')
const { getAllNotices } = require('../../model/notice')


let notice = new Router()

notice.post('/get', async (ctx) => {
  try {
    const notices = getAllNotices()
    ctx.body = generateOk(notices.filter(notice => notice.statu === 1))
  } catch (e) {
    catchError(e, ctx)
  }
})

module.exports = notice